/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.myapp.struts.topics;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

/**
 *
 * @author jaime
 */
public class ChangeTopicAction extends org.apache.struts.action.Action {

    /*
     * forward name="success" path=""
     */
    private static final String SUCCESS = "success";

    @Override
    public ActionForward execute(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        String tema=null;
        String titTema = null;
        HttpSession session=request.getSession();
        session.setAttribute("temaActual",Integer.valueOf(1) );
        session.setAttribute("titTema","MERCURIO");
        tema = request.getParameter("tema");
        titTema = request.getParameter("titTema");
        if(tema!=null){
            session.setAttribute("temaActual", tema);
            session.setAttribute("titTema", titTema);
        }
        
        
        return mapping.findForward(SUCCESS);
    }
    
}
